
package ui;

import com.sun.lwuit.Container;
import com.sun.lwuit.Label;
import com.sun.lwuit.TextField;
import com.sun.lwuit.table.TableLayout;

/**
 *
 * @author Shayan
 */
public class InputField extends Container {

    private TextField textField;

    public TextField getTextField() {
        return textField;
    }

    public String getText() {
        return textField.getText();
    }

    public void setText(String text) {
        textField.setText(text);
    }
    
    public InputField(String label) {
        this(label, false);
    }

    public InputField(String label, boolean fullLineLabel) {
        TableLayout layout = fullLineLabel ?
            new TableLayout(2, 1):
            new TableLayout(1, 2);
        this.setLayout(layout);
        this.addComponent(new Label(label));

        textField = new TextField();
        this.addComponent(textField);
    }

}
